Add Folders to Path

Overview

In the following notebok we visualize hyperbolic OECS in the Agulhas region from the AVISO dataset using Fast Tensorline Computation. The notebook is structured as follows:

  1. Import data from the file 'AVISO.mat' stored in the folder 'data'
  2. Define computational parameters (such as the number of cores) and data
  3. Define spatio-temporal domain.
  4. Interpolate velocity from the (discrete) gridded data
  5. Hyperbolic OECS:

    • Compute rate of strain tensor $ \mathbf{S}(\mathbf{x}, t) $ using an auxiliary meshgrid.

    • Compute eigenvectors $ \mathbf{e}_i $ of the rate of strain tensor $ \mathbf{S}(\mathbf{x}, t) $.

    • Hyperbolic OECS at time $ t $ are given by tensorlines starting from local maxima of $ s_2(x, y) $ which satisfy:

      \begin{equation} S \mathbf{e}_i = s_i \mathbf{e}_i \label{eq: tensorlines} \end{equation}

      $ \mathbf{e}_i $ denotes the eigenvector associated to the eigenvalue $ s_i $ of the rate of strain tensor $ S = S(\mathbf{x},t) $. The vector orthogonal to $ \mathbf{e}_i $ is denoted as $ \mathbf{e}_k $ and corresponds to the eigenvector associated to the eigenvalue $ s_k $ of $ S = S(\mathbf{x},t) $. The eigenvector field is a non-orientable vector field. Hence, computation of the tensorlines require constant checking of the orientation of the eigenvector before performing the integration step. The integration has thus to be done manually and one cannot rely on an automatic ODE solver. The following method highlights a way to compute the tensorlines of $ \mathbf{S} $ without having the deal with the orientational discontinuities of the eigenvector field.

    Tensorlines are parametrized curves $ \mathbf{x}(s) $ such that:

    \begin{equation} \dfrac{d}{ds}\mathbf{x} = \mathbf{e}_i(\phi(s)) =\begin{pmatrix} \cos(\phi(s)) \\ \sin(\phi(s)) \end{pmatrix}. \end{equation} Taking the derivative of \ref{eq: tensorlines} with respect to $ s $ leads to:

    \begin{align} (\nabla_x S \mathbf{e}_i)\mathbf{e}_i + S\mathbf{e}_k\phi' &= \langle \nabla_x s_i, \mathbf{e}_i \rangle I \mathbf{e}_i + s_i\mathbf{e}_k\phi' \\ (S\mathbf{e}_k-s_i\mathbf{e}_k)\phi' &= (\langle \nabla_x s_i, \mathbf{e}_i \rangle I - (\nabla_x S \mathbf{e}_i)) \mathbf{e}_i \end{align}

    Multiplying the above equation from the left with $ \mathbf{e}_k^T $ leads to:

    \begin{align}

         \mathbf{e}_k^T (S\mathbf{e}_k-s_i\mathbf{e}_k) \phi' &= \mathbf{e}_k^T(\langle \nabla_x s_i, \mathbf{e}_i \rangle I - (\nabla_x S \mathbf{e}_i)) \mathbf{e}_i \\
    

    (s_k-s_i) \phi' &= -\mathbf{e}_k^T(\nabla_x S \mathbf{e}_i) \mathbf{e}_i \end{align}

    where we used the property $ S\mathbf{e}_k = \lambda_k \mathbf{e}_k $ and $ \langle \mathbf{e}_i, \dfrac{d}{ds}\mathbf{e}_i \rangle = \langle \mathbf{e}_i, \mathbf{e}_k \rangle = 0 $ for an incompressible flow. Assuming again incompressibility $ s_i = -s_k $ it eventually holds:

    \begin{equation} \phi' = -\dfrac{1}{2s_k}\mathbf{e}_k^T(\nabla_x S \mathbf{e}_i) \mathbf{e}_i \end{equation}

    For repelling OECS, the tensorlines satisfy the ODEs:

    \begin{align} x'(s) &= \cos(\phi(s)) \\ y'(s) &= \sin(\phi(s)) \\ \phi'(s) &= -\dfrac{1}{2s_2}\mathbf{e}_2^T(\nabla_x S \mathbf{e}_1) \mathbf{e}_1 \end{align}

    For attracting OECS, the tensorlines satisfy the ODEs:

    \begin{align} x'(s) &= \cos(\phi(s)) \\ y'(s) &= \sin(\phi(s)) \\ \phi'(s) &= -\dfrac{1}{2s_1}\mathbf{e}_1^T(\nabla_x S \mathbf{e}_2) \mathbf{e}_2 \end{align}

Import Data

Computational parameters and data

Here we define the computational parameters and the data.

Spatio-temporal domain

Here we define the spatio-temporal domain over which to consider the dynamical system.

Interpolate Velocity

In order to evaluate the velocity field at arbitrary locations and times, we must interpolate the discrete velocity data. The interpolation with respect to time is always linear. The interpolation with respect to space can be chosen to be "cubic" or "linear". In order to favour a smooth velocity field, we interpolate the velocity field in space using a cubic interpolant.

Rate of strain tensor over meshgrid of initial conditions

The rate of strain tensor $ S(\mathbf{x}, t) $ at time $ t $ is computed by iterating over meshgrid. The rate of strain tensor at point $ \mathbf{x} $ at time $ t $ is computed from the gradient of the velocity field by using an auxiliary meshgrid. 'aux_grid' specifies the ratio between the auxiliary grid and the original meshgrid. This parameter is generally chosen to be between $ [\dfrac{1}{5}, \dfrac{1}{10}] $.

Compute tensorfield

Interpolate $ \dot{\phi}(x, y, \phi), s_1(x, y), s_2(x, y) $

Find objective Saddle-points

Objective saddles coincide with local maxima in the maximum eigenvalue field $ s $ of the rate of strain tensor.

Compute Initial Conditions ($ x_0, y_0, \phi_0 $) for Hyperbolic OECS

For the spatial coordinates $ (x,y) $ the initial conditions $ x_0, y_0 $ coincide with the objective saddles (=local maxima in the s-field). The inital angle $ \phi_0 $ depends on the orientation of the eigenvector at $ (x_0,y_0) $. As the rate of strain tensor is symmetric, the eigenvectors are mutually orthogonal. As a consequence the angle between the repelling and attracting OECS must necessarily always be 90 degrees.

Compute Attracting/Repelling OECS

It can be verified that the attracting/repelling OECS computed using the Fast Tensorline Computation coincide with those computed in HyperbolicOECS. We note that this procedure is conceptually much easier as it does not require constantly checking the orientation of the eigenvector field and hence can be solved via an ODEsolver.

Advect attracting OECS

Attracting/repelling OECS represent short term attractor/repellors of particles in the flow field. They act as the eulerian counterpart to hyperbolic LCS. Hyperbolic OECS act as a short-term unstable/stable manifold of a saddle point. In order to highlight the validity of the extracted hyperbolic OECS and highlight the predictive power of attracting OECS for short time-intervals, we advected attracting OECSs up to 7 days and study their effect on nearby particles. We seed around every objective saddle a circular blob of particle which also gets advected by the flow. As shown in the below figure, the attracting OECS play a crucial role in shaping the deformation of the blobs. As shown in the below figure, the attracting OECS play a crucial role in shaping the deformation of the blobs as they stretch and attract the blob originally centered around the objective saddle.